package com.linsida.springbootnativedemo.controller;

import ai.djl.ndarray.NDArray;
import ai.djl.ndarray.NDManager;
import ai.djl.ndarray.types.Shape;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *
 * </p>
 *
 * @author linsida
 * @since 2024-01-15
 */
@RestController
public class DemoController {

    private NDManager ndManager = NDManager.newBaseManager();

    @GetMapping("/v1/get-test")
    public String helloworld(){
        NDArray ndArray = ndManager.zeros(new Shape(2, 3));

        return "hello, spring boot native ndArray: \n"+ndArray.toDebugString();
    }
}